#pragma once

#include "Types.h"
#include "DLL.h"

#include <MyFC/TextControl.h>	   
#include <MyFC/ToolBar.h>	   
#include <MyFC/LabelledWidget.h>  
#include <MyFC/DoublyLabelledWidget.h>  

namespace My {

class Sequence;
class SequenceView;

class DLL_API TimeEditControl : public TextControl {
public:
	TimeEditControl();
	~TimeEditControl();
public:
	bool IsEmpty() const;
	void SetSequence(Sequence *);
protected:
	virtual bool GetText(String & s);
	virtual void SetText(const String & s);
public:
	virtual void ProcessEvent(Event &);
	virtual void HandleUpdateUI();
private:
	Sequence * m_pSequence;
};

class DLL_API FramerateEditControl : public TextControl {
public:
	FramerateEditControl();
	~FramerateEditControl();
public:
	bool IsEmpty() const;
	void SetSequenceView(SequenceView *);
protected:
	virtual bool GetText(String & s);
	virtual void SetText(const String & s);
public:
	virtual void ProcessEvent(Event &);
	virtual void HandleUpdateUI();
private:
	SequenceView * m_pSequenceView;
};

class DLL_API TimeControls : public Widget, public Container {
private:
	ToolBar					m_Buttons;
	My::LabelledWidget		m_TimeLabel;	
	TimeEditControl			m_TimeEdit;
	My::DoublyLabelledWidget m_FramerateLabel;	
	FramerateEditControl	m_FramerateEdit;
protected:
	virtual CSize GetPreferredSize() const;
public:
	TimeControls(bool FollowButton = true);
	~TimeControls();
public:
	void SetSequence(Sequence *);
	void SetSequenceView(SequenceView *);
	void SetRealFramerate(float fps);
	void ClearRealFramerate();
public:
	virtual void LayoutControls();
	virtual void ProcessEvent(Event &);
private:
	SequenceView * m_pSequenceView;
};

} // My